<?php
$this->lang->load ( 'nob_trail_inscription', $this->session->userdata ( 'lg' ) );
if (isset ( $valid )) {
	if (! $valid) {
		?>
<ul class="validationError">
	<?php echo validation_errors(); ?>
</ul>
<?php }else{?>
<div class="success">
	<?php echo $this->lang->line('inscr_success')." ".$inscription->firstName." ".$inscription->lastName?>
</div>
<?php
	
}
}
?>

<?php
$limit = new DateTime ( '01/16/2015' );
$now = date ( 'Y-m-d' );
$inscriptionEnd = $now >= $limit;

?>

<div class="info small">
	<label><?php echo $this->lang->line('inscr_price_title');?> </label>
	<p>
		<?php echo $this->lang->line('inscr_price');?>
		<a href="/nobressart/data/trail/Disclaimer.docx">Disclaimer</a>


	</p>
</div>
<div class="info" style="height: 350px;">
	<?php if (!$inscriptionEnd){?>
	<div style="float: left; padding-right: 20px;">
		<?php $this->load->view('courses/trail/form/createAccount_form'); ?>
	</div>
	
	
	<div style="float: left">
		<?php if(isset($inscriptions)){?>
		<table class="listing">
			<thead>
				<tr>
					<th colspan="6"><?php echo $this->lang->line('inscr_last10_title');?>
					</th>
				</tr>
				<tr>
					<th><?php echo $this->lang->line('inscr_tab_last_name');?></th>
					<th><?php echo $this->lang->line('inscr_tab_first_name');?></th>
					<th><?php echo $this->lang->line('inscr_tab_club');?></th>
					<th><?php echo $this->lang->line('inscr_tab_sex');?></th>
					<th><?php echo $this->lang->line('inscr_tab_race');?></th>
					<th>&nbsp;</th>
				</tr>
			</thead>
			<tbody>
				<?php
			$i = 1;
			foreach ( $inscriptions as $currentInscription ) {
				?>
				<tr>
					<td><?php echo $currentInscription->lastName; ?></td>
					<td><?php echo $currentInscription->firstName; ?></td>
					<td><?php echo $currentInscription->club; ?></td>
					<td><?php echo $currentInscription->sex; ?></td>
					<td><?php echo $this->tools->getCourse($currentInscription->course); ?>
					</td>
					<td><?php
				if ($currentInscription->paye == 1) {
					?>
						
							<img alt="payé" src="/nobressart/images/icons/dbtool-green.ico" />
						
					<?php
				} else {
					?>
						
							<img alt="non payé" src="/nobressart/images/icons/dbtool-red.ico" />
						
					<?php
				}
				
				?></td>
				</tr>
				<?php }?>
			</tbody>
		</table>
		<?php }?>
	</div>
	<?php } else{?>
	<div style="float: left">
		<label>Les inscriptions internet sont clôturées.</label> 
		<br/>Vous pourrez vous
		inscrire le jour de la course. Un conseil : Soyez tôt sur place pour
		garantir le départ à l’heure prévue. 
		<br/><label>Internet registrations are closed.</label> 
		<br/>
		Registrations will be possible the day of the Trail. Advice:
		are early on site to guarantee the departure at the planned hour.

	</div>
	<?php }?>
</div>
